package com.ruoyi.shop.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.mapper.ShopFeedbackMapper;
import com.ruoyi.shop.domain.ShopFeedback;
import com.ruoyi.shop.service.IShopFeedbackService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户反馈Service业务层处理
 * 
 * @author Alan Zhang
 * @date 2021-10-14
 */
@Service
public class ShopFeedbackServiceImpl implements IShopFeedbackService 
{
    @Autowired
    private ShopFeedbackMapper shopFeedbackMapper;

    /**
     * 查询用户反馈
     * 
     * @param msgId 用户反馈主键
     * @return 用户反馈
     */
    @Override
    public ShopFeedback selectShopFeedbackByMsgId(Long msgId)
    {
        return shopFeedbackMapper.selectShopFeedbackByMsgId(msgId);
    }

    /**
     * 查询用户反馈列表
     * 
     * @param shopFeedback 用户反馈
     * @return 用户反馈
     */
    @Override
    public List<ShopFeedback> selectShopFeedbackList(ShopFeedback shopFeedback)
    {
        return shopFeedbackMapper.selectShopFeedbackList(shopFeedback);
    }

    /**
     * 新增用户反馈
     * 
     * @param shopFeedback 用户反馈
     * @return 结果
     */
    @Override
    public int insertShopFeedback(ShopFeedback shopFeedback)
    {
        shopFeedback.setCreateTime(DateUtils.getNowDate());
        return shopFeedbackMapper.insertShopFeedback(shopFeedback);
    }

    /**
     * 修改用户反馈
     * 
     * @param shopFeedback 用户反馈
     * @return 结果
     */
    @Override
    public int updateShopFeedback(ShopFeedback shopFeedback)
    {
        return shopFeedbackMapper.updateShopFeedback(shopFeedback);
    }

    /**
     * 批量删除用户反馈
     * 
     * @param msgIds 需要删除的用户反馈主键
     * @return 结果
     */
    @Override
    public int deleteShopFeedbackByMsgIds(String msgIds)
    {
        return shopFeedbackMapper.deleteShopFeedbackByMsgIds(Convert.toStrArray(msgIds));
    }

    /**
     * 删除用户反馈信息
     * 
     * @param msgId 用户反馈主键
     * @return 结果
     */
    @Override
    public int deleteShopFeedbackByMsgId(Long msgId)
    {
        return shopFeedbackMapper.deleteShopFeedbackByMsgId(msgId);
    }
}
